import { BasicColumn } from '/@/components/Table';
import { FormSchema } from '/@/components/Table';

export const columns: BasicColumn[] = [
  {
    title: '函数名称',
    dataIndex: 'name',
    width: 240,
  },
  {
    title: '函数参数',
    dataIndex: 'parameter',
    width: 240,
  },
  {
    title: '创建时间',
    dataIndex: 'createTime',
    width: 300,
  },
];

export const searchFormSchema: FormSchema[] = [
  {
    label: '函数名称',
    field: 'name',
    component: 'Input',
    colProps: { span: 6 },
  },
];

export const formSchema: FormSchema[] = [
  {
    label: '',
    field: 'id',
    component: 'Input',
    show: false,
  },
  {
    label: '函数名称',
    field: 'name',
    required: true,
    component: 'Input',
  },
  {
    label: '函数入参',
    field: 'parameter',
    component: 'Input',
  },
  {
    label: '脚本',
    field: 'script',
    component: 'JCodeEditor',
    componentProps: {
      height: '350px',
      fullScreen: false,
    },
  },
];
